package com.tencent.iov.cowin.befsale.clue.repository.clue.impl;

import com.github.pagehelper.Page;
import com.tencent.iov.cowin.befsale.clue.dao.clue.ClueTodoRelDao;
import com.tencent.iov.cowin.befsale.clue.domain.clue.po.ClueTodoRel;
import com.tencent.iov.cowin.befsale.clue.repository.clue.ClueTodoRelManager;
import com.software.boot.dao.annotation.TargetDataSource;
import com.software.common.consts.DbLinkConfig;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Describe: 线索代办关联表_Manager实现层
 * @author: zhiye.wang
 * @created: 2022-02-11 14:45:46
 * @version: 1.0
 */
@Service
public class ClueTodoRelManagerImpl implements ClueTodoRelManager {
	
	@Autowired
	private ClueTodoRelDao clueTodoRelDao;

	/**
	 * 通过ID获取详细信息
	 *
	 * @param: id
	 * @return: ClueTodoRel对象
	 */
	@Override
	@TargetDataSource(DbLinkConfig.SW_SCRM_READ)
	public ClueTodoRel getDetailById(Long id){
		return clueTodoRelDao.getDetailById(id);
	}

	/**
	 * 单条数据插入ClueTodoRel
	 * @param request
	 * @return 插入的条数
	 */
	@Override
	@TargetDataSource(DbLinkConfig.SW_SCRM_WRITE)
	public int insert(ClueTodoRel request){
		return clueTodoRelDao.insert(request);
    }

	/**
	 * 批量插入ClueTodoRel
	 * @param requests
	 * @return 批量插入的条数
	 */
	@Override
	@TargetDataSource(DbLinkConfig.SW_SCRM_WRITE)
    public int insertBatch(List<ClueTodoRel> requests){
		return clueTodoRelDao.insertBatch(requests);
    }

	/**
	 * 单条ClueTodoRel更新
	 * @param request
	 * @return 更新的条数
	 */
	@Override
	@TargetDataSource(DbLinkConfig.SW_SCRM_WRITE)
    public int update(ClueTodoRel request){
		return clueTodoRelDao.update(request);
    }

	/**
	 * 单条ClueTodoRel删除
	 * @param id
	 * @return 删除的条数
	 */
	@Override
	public int delete(Integer id) {
		return clueTodoRelDao.delete(id);
	}

	/**
	 * 根据条件查询对象list列表
	 * @param request
	 * @return 查询结果
	 */
	@Override
	@TargetDataSource(DbLinkConfig.SW_SCRM_READ)
	public List<ClueTodoRel> getListByParam(ClueTodoRel request){
		return clueTodoRelDao.getListByParam(request);
	}

	/**
	 * 根据条件查询对象page记录
	 * @param request
	 * @param rowBounds
	 * @return 分页对象
	 */
	@Override
	@TargetDataSource(DbLinkConfig.SW_SCRM_READ)
	public Page<ClueTodoRel> getPageByParam(ClueTodoRel request, RowBounds rowBounds){
		return clueTodoRelDao.getPageByParam(request, rowBounds);
	}

	/**
	 * 根据条件查询单个对象
	 * @param request
	 * @return
	 */
	@Override
	public ClueTodoRel getOneByParam(ClueTodoRel request) {
			return clueTodoRelDao.getOneByParam(request);
	}
}
